var test = 6

$('#menubtn').click(function(){
  $("#navBar").css({
    backgroundColor:"white",
  })
})

function mHttp() {
  var tech_time = $('#tech_time').val()
  var job_orrange = $('#job_orrange').val()
  var des_work = $('#des_work').val()
  var back_qusetion = $('#back_qusetion').val()
  var solve_qusetion = $('#solve_qusetion').val()
  var tech_name = $('#tech_name').val()
  var url =  host + '/technology?tech_time=' + tech_time+ '&job_orrange=' + job_orrange + '&des_work=' + des_work + '&back_qusetion=' + back_qusetion + '&solve_qusetion=' + solve_qusetion  + '&tech_name=' + tech_name  
  let httpRequest = new XMLHttpRequest();//第一步：创建需要的对象
  httpRequest.open('POST', url, true); //第二步：打开连接/***发送json格式文件必须设置请求头 ；如下 - */
  // httpRequest.open('GET', url, true); //第二步：打开连接/***发送json格式文件必须设置请求头 ；如下 - */
  httpRequest.setRequestHeader("Access-Control-Allow-Credentials", true);//设置请求头 注：post方式必须设置请求头（在建立连接后设置请求头）var obj = { name: 'zhansgan', age: 18 };
  httpRequest.setRequestHeader("Access-Control-Allow-Origin", "*");
  httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
  var data = 'tech_time=' + tech_time+ '&job_orrange=' + job_orrange + '&des_work=' + des_work + '&back_qusetion=' + back_qusetion + '&solve_qusetion=' + solve_qusetion  + '&tech_name=' + tech_name
  httpRequest.send(data);//发送请求 将json写入send中
  /**
   * 获取数据后的处理程序
   */
  httpRequest.onreadystatechange = function () {//请求后的回调接口，可将请求成功后要执行的程序写在其中
    if (httpRequest.readyState == 4 && httpRequest.status == 200) {//验证请求是否发送成功
      var json = JSON.parse(httpRequest.responseText);//获取到服务端返回的数据
      console.log(json);
      if(json['message'] == '提交成功'){
        alert('提交成功！')
      }else{
        alert('提交失败！')
      }
  }
  };
}